package com.example.guiguihomemedical.mapper;

import com.example.guiguihomemedical.entity.Servicepack;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface ServicepackMapper {
    @Delete("delete from servicepack where id=#{id}")
    void delete(Integer id);

    @Insert("insert into servicepack(name, peopleid, details, cost) values(#{name},#{peopleid},#{details},#{cost})")
    void insert(Servicepack servicepack);

    @Select("select * from servicepack where id=#{id}")
    Servicepack getById(Integer id);

//    @Update("update servicepack set name=#{name},peopleid=#{peopleid},details=#{details},cost=#{cost} where id=#{id}")
    void updateById(Servicepack servicepack);

//    @Select("select * from servicepack where name=#{name}")
List<Servicepack> getByName(String name);
    @Select("select * from servicepack")
    List<Servicepack> getAll();

    @Select("select * from servicepack where type=#{type}")
    List<Servicepack> getByType(String type);
}
